package com.windowes.weichang.controller.platform;

import com.windowes.weichang.common.ServerResponse;
import com.windowes.weichang.service.FormResportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * @author: yangqing
 * @email: qing.yang@bangdao-tech.com
 * @createTime: 2018/7/17 下午9:13
 * @description:
 *
 **/
@RestController
@RequestMapping("report")
@Api(description = "报表管理相关API")
public class FormResportController {

    @Autowired
    FormResportService formResportService;

    @ApiOperation(value = "订单统计", notes = "")
    @GetMapping("order")
    public ServerResponse order(String startTime, String endTime, @RequestParam(value = "pageNo", defaultValue = "1") int pageNo,
                                @RequestParam(value = "pageSize", defaultValue = "15") int pageSize) {
        return formResportService.order(startTime, endTime, pageNo, pageSize);
    }

    @ApiOperation(value = "服务统计", notes = "")
    @GetMapping("service")
    public ServerResponse service(String startTime, String endTime, @RequestParam(value = "pageNo", defaultValue = "1") int pageNo,
                                  @RequestParam(value = "pageSize", defaultValue = "15") int pageSize) {
        return formResportService.service(startTime, endTime, pageNo, pageSize);
    }
}
